package exception;

public class ExceptionAPIDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try {
            String len = "asd";
            System.out.println(Integer.parseInt(len));
        } catch (NumberFormatException e) {
            e.printStackTrace();
            String asd = e.getMessage();//获取错误消息
            System.out.println(asd);
        }
        System.out.println("程序结束了");
    }
}
